package com.example.enjoyarkuix;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.example.enjoyarkuix.bean.ItemDataBean;
import com.example.enjoyarkuix.bridge.BridgeTest;
import com.example.enjoyarkuix.bridge.BridgeUtil;
import com.example.enjoyarkuix.common.Constant;
import com.example.enjoyarkuix.platformview.MyPlatformViewFactory;

import ohos.ace.adapter.capability.bridge.BridgePlugin;
import ohos.stage.ability.adapter.StageActivity;


/**
 * Example ace activity class, which will load ArkUI-X ability instance.
 * StageActivity is provided by ArkUI-X
 *
 * @see <a href=
 * "https://gitee.com/arkui-crossplatform/doc/blob/master/contribute/tutorial/how-to-build-Android-app.md">
 * to build android library</a>
 */
public class EntryEntryAbilityActivity extends StageActivity {
    private BridgeTest bridge = null;
    private BridgeTest bridge_Binary = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        bridge = new BridgeTest(this, "TestBridge", getBridgeManager());
        bridge_Binary = new BridgeTest(this, "Create_Binary_Bridge", getBridgeManager(), BridgePlugin.BridgeType.BINARY_TYPE);
        BridgeUtil.setBridgeTest(bridge);
        setInstanceName("com.example.enjoyarkuix_ios:entry:EntryAbility:");
        super.onCreate(savedInstanceState);

        MyPlatformViewFactory pf = new MyPlatformViewFactory();
        pf.setContext(this);
        pf.setSavedInstanceState(savedInstanceState);
        // register PlatformViewFactory
        registerPlatformViewFactory(pf);
    }
}